version: 0.0.0.{build}
image: Visual Studio 2017

install:
  ############################################################################
  # Install Ninja
  ############################################################################
  - set NINJA_URL="https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip"
  - appveyor DownloadFile %NINJA_URL% -FileName ninja.zip
  - 7z x ninja.zip -oC:\projects\deps\ninja > nul
  - set PATH=C:\projects\deps\ninja;%PATH%
  - ninja --version

before_build:
    - mkdir build
    - cd build
    - mkdir temp
    - cd ../
    - cd build
    - mkdir win64
    - cd win64
    - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
    - cmake -G "Ninja" -DBOOST_ROOT=C:/Libraries/boost_1_69_0 -DQt5_DIR=C:/Qt/5.12.6/msvc2017_64/lib/cmake/Qt5 -DBUILD_JAVA_LANGUAGE_PACKAGE=ON -DBUILD_PYTHON_LANGUAGE_PACKAGE=ON -DCMAKE_BUILD_TYPE=Release ../../
    - cd ../../

build_script:
    - cd build/win64
    - ninja
    - cd ../../

test_script:
    - cd bin/app
    - ..\..\build\win64\Release\app\Sourcetrail.exe config -j "C:/Program Files/Java/jdk1.8.0/jre/bin/server/jvm.dll"
    - cd ../../
    - ps: copy bin/app/user/ApplicationSettings.xml bin/test/data/TestSettings.xml
    - cd bin/test
    - ..\..\build\win64\Release\test\Sourcetrail_test.exe
    - cd ../../
